﻿<?xml version="1.0" encoding="UTF-8"?>
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%
    List<string> colors = new List<string> { "001B63", "BD000D", "7100BD", "00A4BD", "00BD06", "BD5500", "A87B00", "AAE300", "BD008E", "000000" };
    List<string> dates = (List<string>)ViewData["dates"];
    int labelStep = 0;
    float minValue = (float)ViewData["minValue"];
    if (dates != null) { labelStep = (dates.Count / 12); }
    IDictionary<string, List<float>> values = (IDictionary<string, List<float>>)ViewData["values"];
%>

<graph yAxisMinValue="<%=(int)minValue %>" numdivlines='4' baseFontSize="12" labelStep="<%=labelStep %>" lineThickness='1' showValues='0' numVDivLines='10' formatNumberScale='1' legendPosition="right" rotateNames='1' decimalPrecision='1' anchorRadius='2' anchorBgAlpha='0' divLineAlpha='30' showAlternateHGridColor='1' shadowAlpha='50' >
    <categories >
        <%foreach (string date in dates){ %>
        <category Name='<%=date %>' />
        <%} %>
    </categories>
    <%
        int i = 0;
        foreach (KeyValuePair<string, List<float>> item in values){
    %>
    <dataset seriesName='<%=item.Key %>' color='<%=colors[i] %>' anchorBorderColor='<%=colors[i] %>' anchorRadius='2'>
	    <%foreach (float value in item.Value) {%>
        <set value='<%=value %>' />
        <%} %>
    </dataset>
    <%
            i++;
        } 
    %>
</graph>